package com.cea.papyrus.core.treeeditpart.pseudoelement;

import java.util.Collection;

import org.eclipse.uml2.uml.BehavioredClassifier;
import org.eclipse.uml2.uml.Package;

import com.cea.papyrus.core.utils.CollectionUtils;
/**
 * Pseudo element for grouping behaviors tree edit part 
 */
public class PackageBehaviorsGroup implements IBehaviorsGroup {
	
	/** parent {@link BehavioredClassifier} */
	protected Package parent;
	
	/**
	 * Creates a new BehavioredClassifierBehaviorsGroup
	 * @param parent the {@link Package} of this behaviors group
	 */
	public PackageBehaviorsGroup(Package parent) {
		this.parent = parent;
	}
	
	/**
	 * Returns the {@link Package} that owns the behaviors
	 * @return the {@link Package} that owns the behaviors
	 */
	public Package getPackage(){
		return parent;
	}

	/**
	 * {@inheritDoc}
	 */
	public Collection getBehaviors() {
		return CollectionUtils.filteredCollection(getPackage().getPackagedElements(), new BehaviorFilter());
	}
}